home *** CD-ROM | disk | FTP | other *** search
- Path: etek.chalmers.se!chalmers.se!sunic!mcsun!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!math.fu-berlin.de!Sirius.dfn.de!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!rutgers!concert!sas!mozart.unx.sas.com!jamie
- From: jamie@cdevil.unx.sas.com (James Cooper)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: SAS/C 6.0: schelp crashes w/KS1.2
- Message-ID: <BwJ11M.5q5@unx.sas.com>
- Date: 22 Oct 92 14:17:45 GMT
- References: <1992Oct15.143152.7957@ugle.unit.no> <Bw82Fr.5H2@unx.sas.com> <1992Oct20.171858.7826@ugle.unit.no> <BwH38I.FGD@unx.sas.com> <1992Oct21.164539.26394@ida.liu.se>
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Organization: SAS Institute Inc.
- Lines: 50
- Originator: jamie@cdevil.unx.sas.com
- Nntp-Posting-Host: cdevil.unx.sas.com
-
-
- In article <1992Oct21.164539.26394@ida.liu.se>, micja@ida.liu.se (Michael Jansson) writes:
- >
- >In article <BwH38I.FGD@unx.sas.com>, walker@twix.unx.sas.com (Doug Walker) writes:
- >
- >> |> Changing the __stack variable doesn't seem to do anything to my stack size, according
- >> |> to Xoper. I always get the stack size I set in the shell. Is there anything special I
- >> |> should do?
- >>
- >> It's working. Xoper reports the stack size and limits given in the Task structure for
- >> the task; when you specify __stack, you get a new stack allocated, but the Task
- >> structure fields are not modified.
- >
- >Is there a reason for that? I guess I role my own code with SwapStack (or was it
- >StackSwap :-) then, since programs with __stack will be slower otherwise. The
- >reason for that is that some functions in the OS checks for the size of the stack
- >of the caller. If the stack is too small or bogus (as with SAS) then they will
- >allocate a new stack, swap it in, and then de-allocate it when finished. This
- >takes time, especially the de-allocation. The same thing goes for other resident
- >libraries that are written in a sensible way, i.e. check the stack of the caller.
-
- Yes, there's a reason. StackSwap() doesn't exist prior to 2.0, so we'ld
- have to special case it (since there are a lot of 1.3 users still out
- there), which would make your code bigger, and people are always yelling
- when their programs come out bigger... :-\
-
- Also, if I remember correctly, the system libraries check the amount of
- stack *left*, not the amount total. This means they should use the
- stack already in place in the task structure, since we won't have put
- anything at all on it... the only thing that will be there is whatever
- the system puts in place at process startup time.
-
- Besides, this doesn't always happen! We check the amount of stack the
- task already has allocated, and if that amount is >= the value in the
- __stack variable, we don't allocate a new stack, we just let it use the
- current one, just like it always did.
-
- __stack is both a safety feature and a documentation saver. For safety,
- it makes sure your code has a big enough stack, no matter what size the
- user has set in his shell, and you no longer have to document a stack
- size to set, since the startup code will allocate it for you if the user
- didn't set enough beforehand.
-
- --
- ---------------
- Jim Cooper
- (jamie@unx.sas.com) bix: jcooper
-
- Any opinions expressed herein are mine (Mine, all mine! Ha, ha, ha!),
- and not necessarily those of my employer.
-